package com.lingnan.tijian.service.impl;

import com.lingnan.tijian.dto.ApiResponse;
import com.lingnan.tijian.exception.TijianAPPExceptionEnum;
import com.lingnan.tijian.mapper.HospitalMapper;
import com.lingnan.tijian.service.ifac.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HospitalServiceImpl implements HospitalService {

    @Autowired
    HospitalMapper hospitalMapper;

    @Override
    public ApiResponse listHospital(int state) {
        // 返回结果给前端，结果中一定要有医院的列表数据
        return new ApiResponse(ApiResponse.SUCCESS_STATUS,ApiResponse.SUCCESS_DESC,hospitalMapper.selectHospitalByState(state));
    }

    @Override
    public ApiResponse getHospitalById(Integer hpId) {
        return new ApiResponse(ApiResponse.SUCCESS_STATUS,ApiResponse.SUCCESS_DESC,hospitalMapper.selectByPrimaryKey(hpId));
    }
}
